import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.List;
import javax.swing.*;

import java.awt.*;

import javax.swing.JPanel;

public class addSupplier extends JPanel implements MouseListener, MouseMotionListener{
	private Connection connect;
	private Image background, save, cancel;
	private JTextField company, address, contact, email, special;
	 private int goNext=0;
	 
	 public addSupplier(){
		 loadImages();
		 company = new JTextField(50);
		 address = new JTextField(50);
		 contact = new JTextField(50);
		 email = new JTextField(50);
		 special = new JTextField(100);
		 
		 setLayout(null);
			company.setBounds(460,215,300,30);
			address.setBounds(460,255,300,30);
			contact.setBounds(460,297,300,30);
			email.setBounds(460,339,300,30);
			special.setBounds(460,380,300,30);
						
			add(company);
			add(address);
			add(contact);
			add(email);
			add(special);
			
			company.addMouseListener(this);
		    address.addMouseListener(this);
		    contact.addMouseListener(this);
		    email.addMouseListener(this);
		    special.addMouseListener(this);
	 }
	
	public void loadImages(){
	       try{
	           background = new ImageIcon("pics/addSuppbg.png").getImage();
	           save = new ImageIcon("pics/save.png").getImage();
	           cancel = new ImageIcon("pics/cancel.png").getImage();
	          
	        } catch (Exception e) { }
	       
	       repaint();
	   }
	   
	   public void paintComponent(Graphics g){
	       super.paintComponent(g);
	       Graphics2D g2d = (Graphics2D) g;
	       setForeground(Color.black);
	       setFont(new Font("Tahoma",Font.PLAIN,22));
	       g2d.drawImage(background, 0, 0, this);
	       g2d.drawString("addSupplier",180,140);
	       g2d.drawImage(save, 475, 590, this);
	       g2d.drawImage(cancel, 625, 590, this);
	       
	   }
	   
	   public void setGoNext(int d){
		   goNext=1;
	   }
	   
	   public int getGoNext(){
		  return goNext; 
	   }
	   
	   public void Loopy(){
			while(goNext!=1)
				repaint();
			}
	
	
	public void mouseClicked(MouseEvent me) {
	   	
	   }
	   public void mousePressed(MouseEvent me) {
	       
	   }
	   public void mouseReleased(MouseEvent me) {
	       
	   }
	   public void mouseDragged(MouseEvent me) {
	       
	   }
	   public void mouseMoved(MouseEvent me) {
	   
	   }    
	   public void mouseEntered(MouseEvent me) {
	       
	   }
	   public void mouseExited(MouseEvent me) {
	       
	   }
}
